package com.hand.qt24953.order.api.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.hand.qt24953.order.domain.entity.Item;
import com.hand.qt24953.order.domain.entity.SoLine;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hzero.core.base.BaseConstants;
import org.hzero.export.annotation.ExcelColumn;
import org.hzero.export.annotation.ExcelSheet;

import javax.persistence.Transient;
import java.math.BigDecimal;

/**
 * @author qiutao 2019/8/5 18:41
 */
@ApiModel("销售订单行DTO")
@ExcelSheet(zh = "销售订单行", en = "Order line")
public class OrderLineDTO extends SoLine {
    @ApiModelProperty(value = "行金额")
    @ExcelColumn(zh = "行金额", en = "line_amount", pattern = BaseConstants.Pattern.TB_TWO_DECIMAL)
    private BigDecimal lineAmount;
    @ExcelColumn(zh = "行号", en = "line_number")
    private Long lineNumber;
    @ExcelColumn(zh = "数量", en = "order_quantity")
    private BigDecimal orderQuantity;
    @ExcelColumn(zh = "产品单位", en = "order_quantity_uom")
    private String orderQuantityUom;
    @ExcelColumn(zh = "销售单价", en = "unit_selling_price")
    private BigDecimal unitSellingPrice;
    @ExcelColumn(zh = "备注", en = "description")
    private String description;
    @ExcelColumn(zh = "物料编码", en = "item_code")
    private String itemCode;
    @ExcelColumn(zh = "物料描述", en = "item_description")
    private String itemDescription;
    @Transient
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(hidden = true)
    private Item item;

    @Override
    public String toString() {
        return "OrderLineDTO{" +
                "lineAmount=" + lineAmount +
                ", item=" + item +
                "} " + super.toString();
    }

    public String getItemCode() {
        return itemCode;
    }

    public void setItemCode(String itemCode) {
        this.itemCode = itemCode;
    }

    public String getItemDescription() {
        return itemDescription;
    }

    public void setItemDescription(String itemDescription) {
        this.itemDescription = itemDescription;
    }

    public Item getItem() {
        return item;
    }

    public void setItem(Item item) {
        this.item = item;
    }

    public BigDecimal getLineAmount() {
        return lineAmount;
    }

    public void setLineAmount(BigDecimal lineAmount) {
        this.lineAmount = lineAmount;
    }

    @Override
    public Long getLineNumber() {
        return lineNumber;
    }

    @Override
    public void setLineNumber(Long lineNumber) {
        this.lineNumber = lineNumber;
    }

    @Override
    public BigDecimal getOrderQuantity() {
        return orderQuantity;
    }

    @Override
    public void setOrderQuantity(BigDecimal orderQuantity) {
        this.orderQuantity = orderQuantity;
    }

    @Override
    public String getOrderQuantityUom() {
        return orderQuantityUom;
    }

    @Override
    public void setOrderQuantityUom(String orderQuantityUom) {
        this.orderQuantityUom = orderQuantityUom;
    }

    @Override
    public BigDecimal getUnitSellingPrice() {
        return unitSellingPrice;
    }

    @Override
    public void setUnitSellingPrice(BigDecimal unitSellingPrice) {
        this.unitSellingPrice = unitSellingPrice;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public void setDescription(String description) {
        this.description = description;
    }
}
